1. Field of the Invention
The present invention relates to a color image processing apparatus and a pattern extracting apparatus, in particular, to those suitable for extracting a title or the like from a color image.
2. Description of the Related Art
In recent years, as computers and their peripheral units such as printers have become common and their costs have been decreased, color images have been used in a variety of fields. Thus, a technology for dividing a color image into several areas and extracting only a particular area has been desired. For example, a technology for extracting areas with the same color from a color image has been desired. When a color scenery image photographed by a CCD camera is used for an input image to be process, such a technology has been widely desired in many applications for selecting fruit and watching cars and people for securities.
When a color document image is used as an input image, such a technology is expected to automatically extract a document name and a keyword from the image. Examples of such a technology are data retrieval systems such as book categorizing systems in libraries and automatic management systems. In addition, such a technology is used for automatically assigning keywords and file names in groupware for storing and sharing image data as a database. Such information can be used for retrieving desired data from a large number of color document images.
As technologies for extracting a particular area from a color image, the following methods have been proposed.
In the RGB color space clustering method, a color separated image is generated. In other words, pixels of an RGB image photographed by a CCD camera are clustered in the RGB space. With pixels in one cluster, an image of each color is generated. Thus, areas with the same color are extracted. Areas generated in such a method are combined so as to extract a new area.
FIG. 1 is a schematic diagram for explaining the conventional RGB color space clustering method.
In FIG. 1, assuming that a color document image 501 is input, patterns with similar colors are extracted and clustered. For example, assuming that patterns 502 and 507 are blue group colors, a pattern 503 is a green group color, and patterns 504 to 506 are red group colors, a cluster 508 that includes the blue group color patterns 502 and 507, a cluster 509 that includes the green group color pattern 503, and a cluster 510 that includes the red group color patterns 504 to 506 are generated in the RGB space.
When the clusters 508 to 510 are generated, images of the clusters 508 to 510 are generated with pixels that are included therein. Thus, for the cluster 508, a color separated image 501a composed of patterns 502xe2x80x2 and 507xe2x80x2 is generated. For the cluster 509, a color separated image 501b composed of a pattern 503xe2x80x2 is generated. For the cluster 510, a color separated image 501c composed of patterns 504xe2x80x2 to 506xe2x80x2 is generated.
All pixels of an RGB image represented in the RGB space are converted into another color space such as HSV. The pixels are clustered in the color space in a particular manner. Images are generated with pixels that are included in each cluster so as to extract areas with the same colors. The obtained areas are combined so as to extract a new area.
The following technical papers that describe technologies for extracting character areas from color document images are known.
Senda et. al., xe2x80x9cMethod for extracting a character pattern from a color image due to a single color of characters (translated title)xe2x80x9d, The Institute of Electronics, Information and Communication Engineers, Japan, PRU 94-04, pp 17-24,
Uehane et. al., xe2x80x9cExtracting a character area from a color image using iso-color line process (translated title)xe2x80x9d, The Institute of Electronics, Information and Communication Engineers, Japan, PRU 94-09, pp 9-16,
Matsuo et. al., xe2x80x9cExtracting a single color character area from a color document image (translated title)xe2x80x9d, 1997 Annual Convention, The Institute of Electronics, Information and Communication Engineers, Japan, D-12-19,
Matsuo et. al., xe2x80x9cExtracting a character string from a scenery image with gradation and color information (translated title)xe2x80x9d, The Institute of Electronics, Information and Communication Engineers, Japan, PRU 92-121, pp 25-32.
In the area expanding method, adjacent pixels are assigned labels corresponding to only similarities of colors. In other words, the maximum value (max) of each color element of (R, G, B) of pixels represented with RGB is obtained and normalized as (R/max, G/max, B/max). Thus, a normalized image is generated.
FIG. 2 is a schematic diagram showing the conventional area expanding method.
In FIG. 2, pixels P1, P2, and so forth in an image are represented with color elements RGB as PL(R1, G1, B1), P2(R2, G2, B2), and so forth [1].
Next, the maximum value of each color element is obtained. For example, the maximum value of R1, G1, and B1 of a pixel P1 is denoted by maxi. Likewise, the maximum value of R2, G2, and B2 of a pixel P2 is denoted by max2. With the maximum values, each color element is normalized. Thus, normalized pixels P1xe2x80x2 (R1/max1, G1/max1, B1/max1) and P2xe2x80x2(R2/max2, G2/max2, B2/max2) are obtained [2].
The square of the difference of each color element of the normalized pixels P1xe2x80x2 and P2xe2x80x2 is obtained. The results are cumulated so as to obtain the distance between the adjacent pixels P1xe2x80x2 and P2xe2x80x2 as d=(R1/max1xe2x88x92R2/max2)2+(G1/max1xe2x88x92G2/max2)2+(B1/max1xe2x88x92B2/max2 )2 [3].
Thus, when the distance d is smaller than a predetermined fixed threshold value THO, the pixels P1 and P2 are treated as those with the same color and assigned the same label. After all the image is assigned labels, the same color areas with the same labels are extracted.
In the area expanding method, since only adjacent pixels are processed, the process time of this method is shorter than that of the RGB color space clustering method.
For details of the area expanding method, refer to Japanese Patent Laid-Open Publication No. 5-298443.
In addition, as a method for extracting a character area from a color separated image, the above-mentioned method (by Uehane et. al, xe2x80x9cExtracting a character area from a color image using iso-color line processxe2x80x9d, The Institute of Electronics, Information and Communication Engineers, Japan, PRU 94-09, pp 9-16) is known. In this method, a character area is extracted from a color image with the following steps.
Enclosing rectangles in connected areas are obtained from a single-color separated image.
Enclosing rectangles are limited in a predetermined range of the sizes and shapes thereof.
An adjacent rectangle search range of each rectangle is assigned. Rectangles are searched as a group in each search range.
Rectangles with a high linearity of center of gravity are kept in each group.
An enclosing rectangle of each group is obtained and a pattern with a color similar to a color of the area that composed the group is extracted.
However, the conventional clustering method for clustering the same color area of a color image has the following problems.
In the RGB color space clustering method or another color space clustering method (for example, HSV space clustering method), all pixels of the image are clustered. Thus, even if the color of the pattern 502 is different from the color of the pattern 507, when their colors are similar to each other, the patterns 502 and 507 may be categorized as the same cluster 508. In this case, due to the color of the pattern 507, the shape of the cluster of the color of the pattern 502 is varied. Thus, the color range of the cluster of the color of the pattern 502 is distorted. Consequently, the pattern 502 cannot be accurately extracted. For example, when the pattern 502 to be extracted is apart from the pattern 507 with a similar color thereto, if they are extracted as one cluster 508, the color of the cluster 508 becomes a mixed color of the color of the pattern 502 and the color of the pattern 507. The color of the cluster 508 cannot cover the color range of the pattern 502 and the color range of the pattern 508. Thus, holes 511 and 512 may take place in the patterns 502xe2x80x2 and 507xe2x80x2 as the extracted results. Alternatively, contours of the patterns 502xe2x80x2 and 507xe2x80x2 may not be clearly extracted.
In the RGB color space clustering method or another color space clustering method (for example, HSV color space clustering method), since many pixels of all the image are clustered, the calculating time for the clustering process becomes long.
On the other hand, in the area expanding method, to normalize pixels as shown in FIG. 2, since divisions should be performed for each pixel, the number of calculations becomes large. The results of the divisions should be stored as floating-point data for all the pixels. Thus, the memory resource necessary for the process becomes large. Moreover, after the pixels are normalized, adjacent pixels that are equally viewed by the observer may largely deviate from a fixed threshold value depending on the definition of similarities of colors of these pixels. Thus, holes may take place in an area. Alternatively, the contour of an area may not be correctly extracted. In addition, since only the relation of adjacent pixels is considered, when the color gradually varies at the boundary of the character area and the background area, the character area and the background area are assigned the same label.
In the conventional character area extracting method, color separated images are generated corresponding to the number of colors of the entire image. Thus, it takes a long time to generate the color separated images. For example, when a title is extracted from the image, the title tends to be adversely affected by other colors. Thus, the extracting accuracy of the title deteriorates. When an enclosing rectangle of connected areas is obtained, the entire image should be processed for each of the extracted color separated images. Consequently, a plurality of images with the same size (corresponding to the number of extracted colors) are required for a color image. Thus, it takes a long time to process the color image.
In addition, since enclosing rectangles are grouped corresponding to the individual color separated images of the entire color image, it takes a long time to process the color image. When characters to be extracted are clustered to different color separated images, they cannot be properly extracted.
When patterns are grouped, only rectangles in relevant search ranges are extracted. Thus, small portions tend to be dropped from relevant groups. To restore dropped portions, patterns with similar colors are extracted at last. However, at this point, noise with a similar color tends to be extracted.
A first object of the present invention is to provide a color image processing apparatus that performs a distance calculating process for a part of an image area without need to perform a normalizing process.
A second object of the present invention is to provide a pattern extracting apparatus that extracts a pattern at high speed while suppressing the pattern from being dropped.
A third object of the present invention is to provide a pattern extracting apparatus that allows a pattern to be accurately extracted even if the boundary thereof is not clear.
To solve the above described problem, an aspect of the present invention is a color image processing apparatus having a color image inputting unit for inputting a color image and outputting a color image signal, a holding unit for holing the color image signal, and a calculating unit for processing the color image signal, comprising a threshold value assigning unit for assigning a threshold value corresponding to color information of a considered pixel, and a labeling unit for comparing color information of adjacent pixels and assigning the same label to the pixels when the distance thereof is the threshold value or less.
Thus, the threshold value of the distance for determining whether or not to assign the same label to the adjacent pixels can be assigned corresponding to color information of the considered pixel, not a fixed value. Thus, it can be accurately determined whether or not the pixels are in the same range. Consequently, pixels can be accurately extracted from a desired area.
An aspect of the present invention is a color image processing apparatus further comprising an average color calculating unit for obtaining the average color of pixels assigned the same label, and an average color comparing unit for comparing the color of a pixel adjacent to the considered pixel and the average color, wherein the labeling unit assigns the same label to a pixel only when the compared result is in a predetermined range.
Thus, even if the color of an area to be extracted gradually varies and the boundary thereof is not clear, the area to be extracted and an area of a background thereof can be distinguished. Consequently, the extracting accuracy of the area can be improved.
An aspect of the present invention is a color image processing apparatus having a color image inputting unit for inputting a color image and outputting a color image signal, a holding unit for holing the color image signal, and a calculating unit for processing the color image signal, comprising an image reducing unit for reducing the color image signal and generating a reduced image, wherein areas with the same color are obtained from the reduced image and areas corresponding to the obtained areas are extracted corresponding to only a color extracted from the reduced image.
Thus, areas regarded as the same color can be obtained with a reduced image. Consequently, a process for extracting areas regarded as the same color can be performed at high speed.
An aspect of the present invention is a color image processing apparatus, wherein the labeling unit obtains enclosing rectangles of label images and label areas of the reduced image, representative colors thereof, the number of colors in each label area, and colors from the reduced image, obtains rectangles of the original image corresponding thereto, searches a pixel with a color similar to the representative color in the rectangle, and performs a labeling process starting from the searched pixel.
Thus, enclosing rectangles of label images and labels, representative colors thereof, the number of colors in the same label area, and colors are obtained from a reduced image. Corresponding to the obtained results, a rectangle of the original image is obtained. The labeling process can be performed in the rectangle. Thus, the labeling process can be performed at high speed.
An aspect of the present invention is a color image processing apparatus, wherein the labeling unit determines all colors and similarities of areas of the reduced image and assigns the same label to areas when the similarities of the colors of the areas are smaller than the threshold value.
Thus, all colors and their similarities of obtained from a reduced image and similarities of areas of the reduced image are determined. When the similarity of colors of the areas is smaller than the predetermined threshold value, the same label can be assigned to the areas. Thus, a desired area can be extracted as viewed by the naked eye.
An aspect of the present invention is a color image processing apparatus, wherein the threshold value assigning unit determines the similarities of colors of areas with a variable threshold value of three color elements, determines that the similarities of colors of the areas are 0 when the color difference distance of the three color elements of the areas is smaller than the variable threshold value, and determines that the similarities of colors of the areas are larger than the threshold value when the color difference distance of the three color elements of the areas is equal to or larger than the threshold value.
Thus, threshold value elements are assigned three color elements, respectively. When all the three color elements of two colors are less than the respective threshold value (elements), these colors can be treated as the same color. Consequently, the capacity of the table of the threshold values can be decreased. In addition, the labeling process can be very accurately performed.
An aspect of the present invention is a pattern extracting unit, comprising a categorizing unit for categorizing a pattern of an input image corresponding to color information and geometry information of the pattern of the input image.
Thus, when a headline area with the same color is extracted from a color input image, a part of the color input image is limited as the headline area. Patterns are categorized corresponding to color information. A pattern apart from the headline area is removed from an object to be categorized. In addition, a small pattern and a large pattern that are not headline characters can be removed from an object to be categorized corresponding to color information. Thus, the speed of the extracting process of the headline area can be improved.
An aspect of the present invention is a pattern extracting apparatus, comprising a clustering unit for clustering pixels of an input image corresponding to color information of adjacent pixels, and a grouping unit for categorizing the clusters as groups corresponding to color information and geometry information of the clusters obtained by the clustering unit.
Thus, to cluster pixels of an input image, color information of a considered pixel and color information of a pixel adjacent thereto are compared. When all pixels of the input image are compared, the number of times of the comparing process of color information of adjacent pixels becomes the square of the number of pixels of the input image. In contrast, when the color information of a considered pixel is compared with the color information of a pixel adjacent thereto, the number of times of the comparing process becomes the number of pixels of the input image. Thus, the clustering process can be performed at high speed.
Since clusters are categorized as groups, pixels in the same cluster can be integrally handled. Thus, it is not necessary to process individual pixels. Consequently, the grouping process can be performed at high speed. In addition, in a limited range of the input area, clusters with similar colors can be categorized as the same group. Thus, the grouping process can be performed at further higher speed.
An aspect of the present invention is a pattern extracting apparatus for extracting areas in the range of the variation of colors determined in a second resolution as areas with the same color in the case that the areas are determined as the same color in a first resolution and as different colors in the second resolution.
Thus, since the color of a pattern of an input image is represented in a combination of sizes of dots of basic colors, even if an area represented as the same color in the input image is detected as a set of different colors depending on a read resolution, when the input image is read, the range of the same color of the area can be accurately extracted. Consequently, a part of a pattern represented as the same color in the input image can be prevented from being dropped or lost.
An aspect of the present invention is a pattern extracting apparatus, comprising a unit for generating an enclosing rectangle of a label image, a unit for extracting an enclosing rectangle with a size in a predetermined range from the extracted enclosing rectangle, a unit for assigning a search area in a predetermined area of the extracted enclosing rectangle, and a unit for assigning an enclosing rectangle in the search area, or partially disposed in the search area as an alternative to be categorized as a group with respect to the extracted enclosing rectangle.
Thus, among enclosing rectangles generated with label images, an enclosing rectangle that becomes a reference for assigning a search area can be limited to an enclosing rectangle with a predetermined size. Thus, when a character area is extracted from an input image, enclosing rectangles of a small pattern such as noise and a large pattern such as a background or a frame can be prevented from being selected as a reference of a search area for searching a character string. Consequently, a pattern that is not a character string can be suppressed from being categorized as a group. Thus, only a character string can be effectively extracted.
Since a search area for searching a character string is assigned in a predetermined range of a considered enclosing rectangle, only characters in the vicinity of a considered enclosing rectangle can be searched. When a title or the like is extracted from the input image, a character that is apart from the title and that does not compose the title can be prevented from being extracted as the group of the title. Thus, only characters of the title can be effectively extracted.
An aspect of the present invention is a pattern extracting apparatus, comprising a first color information comparing unit for comparing color information of adjacent pixels of an input image, a second color information comparing unit for comparing the color information of the pixels compared by the first color information comparing unit and color information of a label image adjacent thereto, and a labeling unit for assigning labels to pixels corresponding to the compared result of the first color information comparing unit and the compared result of the second color information comparing unit.
Thus, in the case that a color gradually varies, only when color information of adjacent pixels is compared, since the colors of the adjacent pixels are similar, these pixels are assigned the same label. When these pixels are traced, the difference of colors cumulates. Thus, pixels with different colors may be assigned the same label. However, according to the present invention, since color information of a pattern that has been assigned a label can be compared, the labeling process can be performed corresponding to the cumulated value of the difference of colors. Thus, when an area whose color gradually varies is assigned a label corresponding to the compared result of the color information of the adjacent pixels, pixels with different colors can be prevented from being assigned the same label.
An aspect of the present invention is a pattern extracting apparatus, comprising a color difference calculating unit for calculating the color difference between adjacent pixels of an area represented with a particular color, a threshold value assigning unit for assigning a threshold value corresponding to the color difference, and a labeling unit for assigning a label to a pixel adjacent to a pixel represented with the predetermined color corresponding to the threshold value.
Thus, since an input image is printed by halftone printing method, even if the input image is represented in the same color, it may be detected as a set of different colors depending on a read resolution. In this case, an area with the same color can be accurately extracted. Thus, a part of a pattern can be prevented from being dropped or lost from an area represented as the same color in the input image.
An aspect of the present invention is a pattern extracting apparatus further comprising a print model generating unit having meshes of basic colors, basic color dots being disposed at mesh points of the meshes, the meshes being rotated and superimposed each other, the sizes of the basic color dots being varied, so as to generate a color as a print model.
Thus, a color generated by the halftone printing method is virtually generated on a computer. The variation of a color by the halftone printing method can be distinguished without need to analyze the variation of the color by the halftone printing method using a real printed document.
An aspect of the present invention is a pattern extracting apparatus further comprising a color difference table generating unit for generating a color difference table that stores luminance values of colors generated by the print model generating unit and the color difference between adjacent pixels corresponding to the luminance values in each read resolution of the print model.
Thus, regardless of a resolution of a device that reads data from a real printed document, a threshold value for determining whether or not colors that are read from a real printed document are the same can be easily obtained.
An aspect of the present invention is a pattern extracting apparatus further comprising a model resolution estimation processing unit for estimating the read resolution of the print mode for an input image.
Thus, a real printed document that is read by a device can be handled with a print model virtually generated on a computer. The labeling process can be performed with a threshold value generated with a print model to the real printed document that is read by the device.
An aspect of the present invention is a pattern extracting apparatus, wherein the model resolution estimating processing unit estimates a resolution of which a luminance value of a color and a color difference registered in the color difference table optimally confirms to the entire input image as a read resolution of the print model of the input image.
Thus, for a real printed document that is read by a device, an optimum threshold value generated by a print model is applied to the entire input image so as to perform the labeling process.
An aspect of the present invention is a pattern extracting apparatus, wherein the model resolution estimating processing unit estimates a resolution of which a luminance value of a color and a color difference registered in the color difference table optimally confirms to a local area of the input image as a read resolution of the print model of the local area of the input image.
Thus, in an input image that is read by a device from a real printed document, for an area that exceeds a predetermined threshold value of the entire input image, the labeling process can be performed for the area with a threshold value optimum for the area. Consequently, the accuracy of the labeling process can be improved.
An aspect of the present invention is a pattern extracting apparatus, wherein the model resolution estimation processing unit causes a read resolution of the print model to be a fixed value.
Thus, the model resolution estimating process of a real printed document can be omitted. Consequently, the process can be performed at high speed.
An aspect of the present invention is a pattern extracting apparatus, further comprising a grouping unit for categorizing label images labeled by the labeling unit as a group.
Thus, a character area extracted by the labeling process can be categorized as a character string area. Consequently, a title can be effectively extracted.
An aspect of the present invention is a pattern extracting apparatus, wherein the grouping unit determines whether or not to categorize a label image as the same group corresponding to color information and geometry information of an enclosing rectangle of the label image.
Thus, when a headline area with the same color is extracted from an input color image, a pattern is extracted from a limited area of the input color image. A pattern that is apart from a headline area can be removed from an object to be categorized. In addition, a small pattern such as noise and a large pattern such as a background that is not the headline characters can be omitted from an object to be processed. Consequently, the speed of the extracting process for the headline area can be improved. Since a labeled pattern is represented by an enclosing rectangle, a complicated pattern composing a character or the like can be represented in a simple shape. Thus, the storage capacity for the pattern can be decreased. In addition, when the relation of positions of patterns is obtained, the process can be simplified.
An aspect of the present invention is a pattern extracting apparatus, wherein the color information is the representative color of the pattern included in the enclosing rectangle.
Thus, patterns labeled can be compared as enclosing rectangles. When patterns are categorized as a group corresponding to color information, it is not necessary to compare each pixel that composes the patterns. Thus, since the number of elements to be compared can be decreased, the process can be performed at high speed.
An aspect of the present invention is a pattern extracting apparatus, wherein the geometry information is another enclosing rectangle present in a predetermined range of a considered enclosing rectangle.
Thus, when a title area or the like is extracted from an input image, the range of an enclosing rectangle to be categorized as a group can be limited to a range suitable for the title area. The grouping process can be omitted for an area that protrudes from the title area. Thus, the process can be preformed at high speed.
An aspect of the present invention is a pattern extracting apparatus, wherein the geometry information calculating unit has a rectangle number storing unit for storing a rectangle number corresponding to vertical and horizontal coordinates of each enclosing rectangle, a rectangle number extracting unit for extracting a rectangle number included in each of vertical and horizontal coordinates in a predetermined range of a considered enclosing rectangle, and an adjacent rectangle extracting unit for extracting a rectangle number included in both the vertical and horizontal coordinates as another enclosing rectangle in a predetermined range of a considered enclosing rectangle.
Thus, another enclosing rectangle in the predetermined range of the considered enclosing rectangle can be effectively searched.
An aspect of the present invention is a pattern extracting apparatus, wherein the rectangle number storing unit stores rectangle numbers of enclosing rectangles in the order of coordinate values, and wherein the rectangle number extracting unit searches rectangle numbers in the ascending order of the coordinate values and extracts rectangle numbers in each coordinate value.
Thus, when an area for storing a rectangle number of an enclosing rectangle is prepared for each coordinate value, the storage capacity corresponding to enclosing rectangles that are expectedly present in a predetermined range of a considered enclosing rectangle is required. In contrast, according to the present invention, since coordinate values corresponding to real enclosing rectangles are stored, the storage capacity can be decreased.
An aspect of the present invention is a pattern extracting apparatus, wherein the determining unit categorizes two enclosing rectangles as the same group when the two enclosing rectangles are present in a predetermined range of a considered enclosing rectangle and the color difference of the representative colors of the two enclosing rectangles is smaller than a color difference obtained from the color difference table.
Thus, when a title area or the like is extracted from an input image, a range of enclosing rectangles to be categorized can be limited to a range suitable for the title area. When enclosing rectangles are compared and patterns are categorized as a group with color information, the variation of a color in the reading operation of a real printed document can be considered. Thus, the process can be preformed at high speed. In addition, the reading accuracy is improved.
An aspect of the present invention is a pattern extracting apparatus, wherein the grouping unit categorizes a label image as a group corresponding to the thickness of a pattern of the label image. Thus, since characters with different thicknesses can be categorized as different groups, when a title or the like is extracted from an input image, only a character string composed of characters with the same thickness can be extracted as a title. Thus, the extracting accuracy of the title can be improved.
An aspect of the present invention is a pattern extracting apparatus, wherein the grouping unit has a contour tracing unit for obtaining the contour length of the pattern, an area calculating unit for obtaining the area of the pattern, and a thickness calculating unit for obtaining the thickness of the pattern corresponding to the ratio of the area of the pattern and the contour length of the pattern.
Thus, the thickness of the pattern can be accurately obtained.
An aspect of the present invention is a pattern extracting apparatus, wherein the contour tracing unit searches a second pixel that is the contour of a pattern with a first pixel that is the contour of the pattern in such a manner that the second pixel is searched from eight pixels that are adjacent to the first pixel and that are adjacent to a source pixel of the first pixel.
Thus, to search a second pixel that becomes the contour of a pattern from a first pixel that becomes the contour of the pattern, eight pixels adjacent to the first pixel are searched in a predetermined direction. When a point of which the level of a pixel is changed from the level of a background to the level of the pattern is the second pixel, the first pixel that has already been extracted can be prevented from being extracted again as a point of the contour of the pattern. Thus, the speed of the contour tracing process can be improved.
An aspect of the present invention is a pattern extracting apparatus, further comprising a character size estimating unit for estimating the character size corresponding to the size of an enclosing rectangle categorized as a group, and a rectangle deleting unit for deleting an enclosing rectangle that exceeds a predetermined range of the character size from the group of the enclosing rectangles.
Thus, even if a pattern of a picture or the like is present in the vicinity of a title and the pattern of the picture is categorized as a group of characters that composes the title, the pattern of the picture can be removed from the group. Thus, the accuracy for extracting the title can be improved.
An aspect of the present invention is a pattern extracting apparatus, further comprising a character string direction estimating unit for estimating the direction of a character string corresponding to the arrangement of enclosing rectangles categorized as a group by the grouping unit, and a character string extracting unit for extracting a character string corresponding to the arrangement of enclosing rectangles categorized as a group by the grouping unit.
Thus, an area of which enclosing rectangles are irregularly disposed and an area of which enclosing rectangles are regularly disposed can be distinguished. Consequently, an area of which enclosing rectangles are regularly disposed can be treated as a title area. Thus, only the title area can be effectively extracted.
An aspect of the present invention is a pattern extracting apparatus, further comprising a re-grouping unit for re-categorizing enclosing rectangles in a group corresponding to the size of the enclosing rectangles categorized as a group.
Thus, characters with different sizes can be categorized as different groups. Consequently, when a title or the like is extracted from an input image, only a character string composed of characters with the same size can be treated as-a title. Thus, the extracting accuracy for a title can be improved.
An aspect of the present invention is a pattern extracting apparatus, further comprising an enclosing rectangle extracting unit for extracting an enclosing rectangle with a predetermined size from enclosing rectangles categorized as a group by the grouping unit, a horizontal arrangement flag assigning unit for assigning a horizontal arrangement flag to enclosing rectangles that are extracted as adjacent enclosing rectangles and whose upper edges or lower edges are close, a vertical arrangement flag assigning unit for assigning a vertical arrangement flag to enclosing rectangles that are extracted as adjacent enclosing rectangles and whose left edges or right edges are close, a character string direction determining unit for determining the direction of a character string of the group corresponding to the number of the horizontal arrangement flags and the vertical arrangement flags, and a character string determining unit for determining whether the enclosing rectangles of the group are enclosing rectangles of a character string corresponding to the ratio of the enclosing rectangles of the group with the flags corresponding to the determined direction of the character string.
Thus, it can be determined whether or not enclosing rectangles in a group are arranged in a row. A group of enclosing rectangles arranged in a row can be treated as a title area. Thus, a title can be effectively extracted from an input image.
An aspect of the present invention is a pattern extracting apparatus, further comprising an enclosing rectangle generating unit for generating an enclosing rectangle categorized as a group by the grouping unit, and a representative color calculating unit for calculating the representative color of the group corresponding to the representative color of the pattern of the group categorized by the grouping unit.
Thus, corresponding to all colors of a title area, the color of a title can be calculated. The influence of color difference in a local area of the title area can be alleviated. Consequently, the extracting accuracy for the title area can be improved.
An aspect of the present invention is a pattern extracting apparatus, further comprising a group combining unit for combining adjacent enclosing rectangles of the group corresponding to the representative color of the group.
Thus, even if characters composing the same title are categorized as different groups due to a slight color difference, these characters can be categorized as the same group. Thus, a title area can be effectively extracted.
An aspect of the present invention is a pattern extracting apparatus, wherein the group combining unit combines adjacent enclosing rectangles of a group when the difference of the sizes of the adjacent enclosing rectangles is in a predetermined range and the difference of representative colors of the group is in a predetermined range.
Thus, when enclosing rectangles of a group are combined, only characters that compose the same title can be effectively combined.
An aspect of the present invention is a pattern extracting apparatus, further comprising a re-extracting unit for re-extracting a pixel of an original image in the range of enclosing rectangles of the group corresponding to the representative color of the group.
Thus, even if characters composing a title include a sonant letter or a semi-sonant letter and the sonant letter or the semi-sonant is dropped from the group of the title due to a local color difference of the title area, the color of the sonant letter or the semi-sonant letter can be compared with the entire color of the title area so as to re-extract the sonant letter or the semi-sonant letter. Consequently, the extracting accuracy for the title can be improved.
An aspect of the present invention is a pattern extracting apparatus, further comprising a digitizing unit for digitizing a pixel that has been re-extracted, a second labeling unit for assigning a label to the digitized image, and an adding unit for adding an enclosing rectangle that has been assigned a label by the second labeling unit and that is larger than a predetermined threshold value to the group.
Thus, when a sonant letter or a semi-sonant letter is re-extracted from the title area, even if a thin noise with the same color as the title is present in the title area, only the noise can be deleted. Consequently, the extracting accuracy for the title can be improved.
An aspect of the present invention is a pattern extracting apparatus, further comprising an output order determining unit for determining the output order of patterns in a group corresponding to the areas of enclosing rectangles categorized as the group, the positions thereof, and the relation of the positions thereof.
Thus, even if a plurality of title alternatives are extracted from an input image, the likelihood of a title can be evaluated. Consequently, title alternatives can be output in the order of the maximum likelihood of the title.
An aspect of the present invention is a pattern extracting apparatus, further comprising a binary pattern generating unit for generating a binary pattern of which a label image of enclosing rectangles categorized as a group is assigned level 1.
Thus, a binary image can be generated with a label image labeled with color information. Consequently, a pattern extracted from a color image can be effectively recognized.